package types

import "fmt"

type AppConfig struct {
	Path        string `toml:"-"`
	Listen      string
	ProxyURL    string
	PostgresDns string // postgres 连接地址
	Redis       RedisConfig
	StaticDir   string // 静态资源目录
	StaticUrl   string // 静态资源 URL
}

type RedisConfig struct {
	Host     string
	Port     int
	Password string
	DB       int
}

func (c RedisConfig) Url() string {
	return fmt.Sprintf("%s:%d", c.Host, c.Port)
}
